<!doctype html>
<head>
<meta charset="utf-8">
<title>张慧琴20187821018</title>
</head>

<body>
<?php
class xStudent {
	public $no;
	public $name;
	public $bj;
	public $dis;
	
	function __construct($noo, $nam, $bo,$c) {
		$this->no = $noo;
		$this->name = $nam;
		$this->bj = $bo;
		$this->dis =$c ; 
	}

	function showxStudent() {
		echo "学号：" . $this->no . "  姓名：" . $this->name . "  性别：" . $this->bj . " 班级 : " . $this->dis ."<br>";
	}
}
$stu = new xStudent("20187821018", "张慧琴", "女", "18电商" );
$stu->showxStudent();

class student {
//父类
	public $sno;
	public $name;
	public $sex;
	function __construct($n, $a, $s) {
		$this->sno = $n;
		$this->name = $a;
		$this->sex = $s;
	}
	function show() {
		echo "学号\t姓名\t性别<br>";
		echo $this->sno . "\t" . $this->name . "\t" . $this->sex . "\t" . "<br>";
	}
}
class dstudent extends student {
	//子类student 继承 person
	public $class;
	function __construct($n, $a, $s,$b) {
		parent::__construct($n, $a, $s);
		$this->class = $b;
	}
	function show() {
		parent::show();
		echo "院系<br>";
		echo$this->class . "<br>";
	}
}
$dstudent = new dstudent("187521119", "胡兵", "男", "药学院");
$dstudent->show();
?>
</body>
</html>